#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>

//struct Stu
//{
//	char name[20];
//	int age;
//};
//void print(struct Stu* ps)
//{
//	printf("%s %d\n", ps->name, ps->age);
//}
//int main()
//{
//	struct Stu s = { "zhangsan",18 };
//	print(&s);
//	return 0;
//}


struct Stu
{
	char name[20];
	int age;
};

int cmp_stu_by_name(const void* p1, const void* p2)
{
	return strcmp(((struct Stu*)p1)->name, ((struct Stu*)p2)->name);
}


void test2()
{
	struct Stu arr[3] = { {"zhangsan",20},{"lisi",35}, {"wangwu",18} };
	int sz = sizeof(arr) / sizeof(arr[0]);
	qsort(arr, sz, sizeof(arr[0]), cmp_stu_by_name); 
}
int main()
{
	return 0;
}